/**
 *  iBizSys 5.0 机器人生产代码（不要直接修改当前代码）
 *  http://www.ibizsys.net
 */
package com.sa.ibiz.demo.demoapp.rtsys.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import net.ibizsys.paas.appmodel.AppModelGlobal;
import net.ibizsys.paas.appmodel.IApplicationModel;
import net.ibizsys.paas.demodel.DEModelGlobal;
import net.ibizsys.paas.demodel.IDataEntityModel;
import net.ibizsys.paas.service.IService;
import net.ibizsys.paas.service.ServiceGlobal;
import net.ibizsys.paas.sysmodel.ISystemModel;
import net.ibizsys.paas.sysmodel.SysModelGlobal;
import net.ibizsys.paas.controller.ViewControllerGlobal;
import net.ibizsys.paas.ctrlmodel.ICtrlModel;
import net.ibizsys.paas.ctrlhandler.ICtrlHandler;


import com.sa.ibiz.demo.srv.OverDesignSysModel;
import com.sa.ibiz.demo.demoapp.DemoAppAppModel;


/**
 * 视图[UserGroupEditView3]控制类基类
 *
 * !! 不要对此代码进行修改
 */
@Controller
@RequestMapping(value = "/DemoApp/RTSys/UserGroupEditView3.do")
public class UserGroupEditView3Controller extends net.ibizsys.paas.controller.EditView3ControllerBase {
    public UserGroupEditView3Controller() throws Exception {
        super();
        this.setId("afac8436292352a66def49030e47e5f8");
        this.setCaption("用户组");
        this.setTitle("用户组编辑视图");
        this.setAccessUserMode(2);
        //
        this.setAttribute("UI.CTRL.DRTAB","TRUE");
        //
        this.setAttribute("UI.CTRL.FORM","TRUE");
        //显示数据信息栏
        this.setAttribute("UI.SHOWDATAINFOBAR","TRUE");
        //
        this.setAttribute("UI.CTRL.TOOLBAR","TRUE");

        ViewControllerGlobal.registerViewController("/DemoApp/RTSys/UserGroupEditView3.do",this);
        ViewControllerGlobal.registerViewController("com.sa.ibiz.demo.demoapp.rtsys.controller.UserGroupEditView3Controller",this);
    }


    @Override
    protected void prepareViewParam() throws Exception {
        super.prepareViewParam();


    }

    private OverDesignSysModel overDesignSysModel;

    public  OverDesignSysModel getOverDesignSysModel() {
        if(this.overDesignSysModel==null) {
            try {
                this.overDesignSysModel = (OverDesignSysModel)SysModelGlobal.getSystem("com.sa.ibiz.demo.srv.OverDesignSysModel");
            } catch(Exception ex) {
            }
        }
        return this.overDesignSysModel;
    }

    @Override
    public  ISystemModel getSystemModel() {
        return this.getOverDesignSysModel();
    }


    private DemoAppAppModel demoAppAppModel;
    public  DemoAppAppModel getDemoAppAppModel() {
        if(this.demoAppAppModel==null) {
            try {
                this.demoAppAppModel = (DemoAppAppModel)AppModelGlobal.getApplication("com.sa.ibiz.demo.demoapp.DemoAppAppModel");
            } catch(Exception ex) {
            }
        }
        return this.demoAppAppModel;
    }

    @Override
    public  IApplicationModel  getAppModel() {
        return this.getDemoAppAppModel();
    }





    private net.ibizsys.psrt.srv.common.demodel.UserGroupDEModel userGroupDEModel;

    public  net.ibizsys.psrt.srv.common.demodel.UserGroupDEModel getUserGroupDEModel() {
        if(this.userGroupDEModel==null) {
            try {
                this.userGroupDEModel = (net.ibizsys.psrt.srv.common.demodel.UserGroupDEModel)DEModelGlobal.getDEModel("net.ibizsys.psrt.srv.common.demodel.UserGroupDEModel");
            } catch(Exception ex) {
            }
        }
        return this.userGroupDEModel;
    }

    public  IDataEntityModel getDEModel() {
        return this.getUserGroupDEModel();
    }

    public  net.ibizsys.psrt.srv.common.service.UserGroupService getUserGroupService() {
        try {
            return (net.ibizsys.psrt.srv.common.service.UserGroupService)ServiceGlobal.getService("net.ibizsys.psrt.srv.common.service.UserGroupService",this.getSessionFactory());
        } catch(Exception ex) {
            return null;
        }
    }

    /* (non-Javadoc)
    * @see net.ibizsys.paas.controller.IViewController#getService()
    */
    @Override
    public IService getService() {
        return getUserGroupService();
    }





    /**
     * 准备部件模型
     * @throws Exception
     */
    @Override
    protected void prepareCtrlModels()throws Exception {
        //注册 drtab
        ICtrlModel drTab=(ICtrlModel)getOverDesignSysModel().createObject("com.sa.ibiz.demo.demoapp.srv.common.ctrlmodel.UserGroupDR2DRTabModel");
        drTab.init(this);
        this.registerCtrlModel("drtab",drTab);
        //注册 form
        ICtrlModel editForm=(ICtrlModel)getOverDesignSysModel().createObject("com.sa.ibiz.demo.demoapp.srv.common.ctrlmodel.UserGroupMain2EditFormModel");
        editForm.init(this);
        this.registerCtrlModel("form",editForm);
    }

    /**
     * 准备部件处理对象
     * @throws Exception
     */
    @Override
    protected void prepareCtrlHandlers()throws Exception {
        //注册 drtab
        ICtrlHandler drTab = (ICtrlHandler)getOverDesignSysModel().createObject("com.sa.ibiz.demo.demoapp.rtsys.ctrlhandler.UserGroupEditView3DRTabHandler");
        drTab.init(this);
        this.registerCtrlHandler("drtab",drTab);
        //注册 form
        ICtrlHandler editForm = (ICtrlHandler)getOverDesignSysModel().createObject("com.sa.ibiz.demo.demoapp.rtsys.ctrlhandler.UserGroupEditView3EditFormHandler");
        editForm.init(this);
        this.registerCtrlHandler("form",editForm);
    }


    /**
     * 注册界面行为
     * @throws Exception
     */
    @Override
    protected void prepareUIActions()throws Exception {

    }
}